<template>
  <div class="anesthesiaEvaluation">
    <div slot="footer" class="dialog-footer clearfix">
      <div style="float: left; line-height: 32px;padding-left: 12px;">
        评估
        <span style='color: #999;font-size:12px;'>
          对预约的病人进行麻醉评估
        </span>
      </div>
      <div style="float: right;">
        <el-button type="primary" @click="submitForm('dialogLeftTop1_3_data',0)">暂存</el-button>
        <el-button type="success" @click="submitForm('dialogLeftTop1_3_data',1)">确认提交</el-button>
        <el-button type="info" @click="cancel">取 消</el-button>
      </div>
    </div>
    <div class="scrollWrap" ref='scrollWrap'>
      <div class="appointmentInfoBox">
        <div class="box">
          <appointment-info :appointment='appointmentInfo'></appointment-info>
        </div>
      </div>

      <div class="pathBox margin20">
        <div class="box">
          <h3>手术路径</h3>
          <surgery-path :appointment='appointment'></surgery-path>
        </div>
      </div>

      <div class="margin20">
        <div class="box">
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="评估单" name="first">
              <h4>一 简要病史 体检及辅助检查</h4>
              <el-form :model="dialogLeftTop1_3_data" ref='dialogLeftTop1_3_data' :show-message=true
                       :rules="appointmentConfirmConst.anesthesiaEvaluation_rules" :inline="true">

                <el-form-item label="体重" :label-width="formLabelWidth" prop="anaesthesiaAssessment.weight">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.weight" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">kg</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="身高" :label-width="formLabelWidth" prop="anaesthesiaAssessment.height">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.height" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">cm</template>
                  </el-input>
                </el-form-item>

                <el-form-item label="BMI" :label-width="formLabelWidth" prop="anaesthesiaAssessment.bmi">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.bmi" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">kg/m <sup>2</sup></template>
                  </el-input>
                </el-form-item>
                <el-form-item label="血压" :label-width="formLabelWidth" prop="anaesthesiaAssessment.bloodPressure">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.bloodPressure" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">mmhg</template>
                  </el-input>
                </el-form-item>

                <el-form-item label="心率" :label-width="formLabelWidth" prop="anaesthesiaAssessment.heartRate">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.heartRate" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">次/分</template>
                  </el-input>
                </el-form-item>

                <el-form-item label="呼吸" :label-width="formLabelWidth" prop="anaesthesiaAssessment.breathFreq">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.breathFreq" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">次/分</template>
                  </el-input>
                </el-form-item>

                <el-form-item label="体温" :label-width="formLabelWidth" prop="anaesthesiaAssessment.breathFreq">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.temperature" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">摄氏度</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="血型" :label-width="formLabelWidth" prop="anaesthesiaAssessment.bloodType">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.bloodType" placeholder="请选择"
                               style='width: 196px' dict-code="boool_type">
                  </dict-select>
                </el-form-item>

                <el-form-item label="系统病史及治疗药物" :label-width="formLabelWidth" prop="anaesthesiaAssessment.medicalBrug">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.medicalBrug" auto-complete="off"
                            placeholder="请输入"></el-input>
                </el-form-item>

                <el-form-item label="手术麻醉史" :label-width="formLabelWidth"
                              prop="anaesthesiaAssessment.optAnaesthesiaHistory">
                  <el-radio-group v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.optAnaesthesiaHistory">
                    <el-radio :label="3">有</el-radio>
                    <el-radio :label="6">无</el-radio>
                  </el-radio-group>
                </el-form-item>

                <el-form-item label="并发症" :label-width="formLabelWidth" prop="anaesthesiaAssessment.complication">
                  <el-radio-group v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.complication">
                    <el-radio :label="3">有</el-radio>
                    <el-radio :label="6">无</el-radio>
                  </el-radio-group>
                </el-form-item>

                <el-form-item label="过敏史" :label-width="formLabelWidth" prop="anaesthesiaAssessment.anaphylaxisHistory">
                  <el-radio-group v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.anaphylaxisHistory">
                    <el-radio :label="3">有</el-radio>
                    <el-radio :label="6">无</el-radio>
                  </el-radio-group>
                </el-form-item>

                <el-form-item label="过敏物" :label-width="formLabelWidth" prop="anaesthesiaAssessment.anaphylaxis">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.anaphylaxis" placeholder="请选择"
                               style='width: 196px' dict-code="guomingwu" multiple>
                  </dict-select>
                </el-form-item>

                <el-form-item label="头颈部" :label-width="formLabelWidth" prop="anaesthesiaAssessment.neck">
                  <el-checkbox-group v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.neck">
                    <el-checkbox :label="0">有异常</el-checkbox>
                    <el-checkbox :label="1">无异常</el-checkbox>
                    <el-checkbox :label="2">疤痕</el-checkbox>
                    <el-checkbox :label="3">颈短</el-checkbox>
                    <el-checkbox :label="4">后仰困难</el-checkbox>
                    <el-checkbox :label="5">颈部肿块</el-checkbox>
                    <el-checkbox :label="6">其他</el-checkbox>
                  </el-checkbox-group>
                </el-form-item>

                <el-form-item label="口腔" :label-width="formLabelWidth" prop="anaesthesiaAssessment.fingerNum">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.fingerNum" placeholder="请选择"
                               style='width: 196px' dict-code="kouqiang">
                  </dict-select>
                </el-form-item>
                <el-form-item label="牙齿" :label-width="formLabelWidth" prop="anaesthesiaAssessment.tooth">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.tooth" placeholder="请选择"
                               style='width: 196px' dict-code="yachi">
                  </dict-select>
                </el-form-item>
                <el-form-item label="心肺听诊" :label-width="formLabelWidth" prop="anaesthesiaAssessment.cardiopulmonary">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.cardiopulmonary" placeholder="请选择"
                               style='width: 196px' dict-code="xinfeitingzhen">
                  </dict-select>
                </el-form-item>
                <el-form-item label="脊柱状况" :label-width="formLabelWidth" prop="anaesthesiaAssessment.spinalStatus">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.spinalStatus" placeholder="请选择"
                               style='width: 196px' dict-code="jizhuzhuangkuang">
                  </dict-select>
                </el-form-item>
                <el-form-item label="上肢肌力及感觉" :label-width="formLabelWidth"
                              prop="anaesthesiaAssessment.upMuscleStrength">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.upMuscleStrength" placeholder="请选择"
                               style='width: 196px' dict-code="shangzhijili">
                  </dict-select>
                </el-form-item>
                <el-form-item label="下肢肌力及感觉" :label-width="formLabelWidth"
                              prop="anaesthesiaAssessment.downMuscleStrength">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.downMuscleStrength"
                               placeholder="请选择" style='width: 196px' dict-code="xiazhijili">
                  </dict-select>
                </el-form-item>
                <el-form-item label="外周静脉" :label-width="formLabelWidth" prop="anaesthesiaAssessment.peripheralVein">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.peripheralVein" placeholder="请选择"
                               style='width: 196px' dict-code="waizhoujingmai">
                  </dict-select>
                </el-form-item>
                <el-form-item label="心电图" :label-width="formLabelWidth" prop="anaesthesiaAssessment.electrocardiogram">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.electrocardiogram" placeholder="请选择"
                               style='width: 196px' dict-code="xindiantu">
                  </dict-select>
                </el-form-item>
                <el-form-item label="心超" :label-width="formLabelWidth" prop="anaesthesiaAssessment.xinchao">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.xinchao" placeholder="请选择"
                               style='width: 196px' dict-code="xinchao">
                  </dict-select>
                </el-form-item>
                <el-form-item label="心功能分级" :label-width="formLabelWidth"
                              prop="anaesthesiaAssessment.heartFunctionLevel">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.heartFunctionLevel"
                               placeholder="请选择" style='width: 196px' dict-code="xingongnengfenji">
                  </dict-select>
                </el-form-item>
                <el-form-item label="肺功能" :label-width="formLabelWidth" prop="anaesthesiaAssessment.lungFunction">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.lungFunction" placeholder="请选择"
                               style='width: 196px' dict-code="feigongneng">
                  </dict-select>
                </el-form-item>
                <el-form-item label="胸片/胸部CT" :label-width="formLabelWidth" prop="anaesthesiaAssessment.chestCt">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.chestCt" placeholder="请选择"
                               style='width: 196px' dict-code="xiongpian">
                  </dict-select>
                </el-form-item>
                <el-form-item label="肝功能" :label-width="formLabelWidth" prop="anaesthesiaAssessment.liverFunction">
                  <el-input style='width: 196px'
                            type="textarea"
                            :rows="2"
                            placeholder="请输入内容"
                            v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.liverFunction">
                  </el-input>
                </el-form-item>
                <el-form-item label="肾功能" :label-width="formLabelWidth" prop="anaesthesiaAssessment.renalFunction">
                  <el-input style='width: 196px'
                            type="textarea"
                            :rows="2"
                            placeholder="请输入内容"
                            v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.renalFunction">
                  </el-input>
                </el-form-item>

                <el-form-item label="血红蛋白" :label-width="formLabelWidth" prop="anaesthesiaAssessment.hemoglobin">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.hemoglobin" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">g/L</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="红细胞" :label-width="formLabelWidth" prop="anaesthesiaAssessment.redBloodCel">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.redBloodCel" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">*10/L</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="血细胞比容" :label-width="formLabelWidth" prop="anaesthesiaAssessment.erythrocrit">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.erythrocrit" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">%</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="凝血酶时间" :label-width="formLabelWidth" prop="anaesthesiaAssessment.thrombinTime">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.thrombinTime" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">S</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="血钾" :label-width="formLabelWidth" prop="anaesthesiaAssessment.bloodPotassium">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.bloodPotassium" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">mol/L</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="血钠" :label-width="formLabelWidth" prop="anaesthesiaAssessment.bloodSodium">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.bloodSodium" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">mol/L</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="血氧" :label-width="formLabelWidth" prop="anaesthesiaAssessment.bloodOxygen">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.bloodOxygen" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">mol/L</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="血糖" :label-width="formLabelWidth" prop="anaesthesiaAssessment.bloodSugar">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.bloodSugar" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">mol/L</template>
                  </el-input>
                </el-form-item>

                <el-form-item label="ASA评级" :label-width="formLabelWidth" prop="anaesthesiaAssessment.asaLevel">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.asaLevel" placeholder="请选择"
                               style='width: 196px' dict-code="asapj">
                  </dict-select>
                </el-form-item>
                <br>
                <el-form-item label="其他实验室检查异常（血气分析等）" label-width="400"
                              prop="anaesthesiaAssessment.otherInspectExcept">
                  <el-input style="width: 396px;"
                            type="textarea"
                            :rows="2"
                            placeholder="请输入内容"
                            v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.otherInspectExcept">
                  </el-input>
                </el-form-item>
                <br>
                <h4>二 麻醉方式及监测方式</h4>
                <el-form-item label="麻醉方式选择" :label-width="formLabelWidth" prop="anaesthesiaAssessment.anaesthesiaType">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.anaesthesiaType" placeholder="请选择"
                               style='width: 196px' dict-code="mzlb">
                  </dict-select>
                </el-form-item>
                <el-form-item label="监测方式选择" :label-width="formLabelWidth">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.checkType" placeholder="请选择"
                               style='width: 196px' dict-code="jiancefangshi">
                  </dict-select>
                </el-form-item>
                <h4>三 围术期麻醉管理</h4>
                <el-form-item label="麻醉管理" :label-width="formLabelWidth"
                              prop="anaesthesiaAssessment.anaesthesiaManageType">
                  <el-checkbox-group v-model="anaesthesiaManageType" @change="getAnaesthesiaManageType()">
                    <el-checkbox :label="0">密切监测</el-checkbox>
                    <el-checkbox :label="1">合理容量管理</el-checkbox>
                    <el-checkbox :label="2">持续各项体征平稳</el-checkbox>
                  </el-checkbox-group>
                </el-form-item>
                <br/><br/>
              </el-form>
            </el-tab-pane>
            <el-tab-pane label="告知单" name="second">
              <el-form label-position="top">

                <el-form-item label='根据手术治疗或诊断检查的需要，患者需要进行麻醉。虽然在麻醉前已经采取力所能及的预防措施，但由于个体差异有可能发生麻醉意外和并发症。现告知如下：'
                              prop="anaesthesiaAssessment.noticeNos">
                  <!-- <el-checkbox-group v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.noticeNos" @change="aa(dialogLeftTop1_3_data.anaesthesiaAssessment.noticeNos)"> -->
                  <el-checkbox-group v-model="noticeNos" @change="getNoticeNos">
                    <el-checkbox :label='1'>
                      1、全麻时可能存在气管插管困难，导致通气不能维持，缺氧可危及生命，需要进行紧急器官切开。插管与拔管是可能损伤牙齿、导致牙齿脱落、发生呕吐、返流、误吸、喉痉挛、喉水肿、气道阻塞、声音嘶哑、鼻衄等
                    </el-checkbox>
                    <br><br>
                    <el-checkbox :label="2">
                      2、椎管内麻醉可能引起术后头痛、尿潴留、全脊髓麻醉、神经损伤、推管内感染、硬膜外血肿及下肢感觉或运动障碍等。
                    </el-checkbox>
                    <br><br>
                    <el-checkbox :label="3">
                      3、区域阻滞麻醉可引起神经损伤、局部血肿、气胸等。
                    </el-checkbox>
                    <br><br>
                    <el-checkbox :label="4">
                      4、区域阻滞麻醉可引起神经损伤、局部血肿、气胸等。
                    </el-checkbox>
                    <br><br>
                    <el-checkbox :label="5">
                      5、椎管内麻醉可能引起术后头痛、尿潴留、全脊髓麻醉、神经损伤、推管内感染、硬膜外血肿及下肢感觉或运动障碍等。
                    </el-checkbox>
                    <br><br>
                    <el-checkbox :label="6">
                      6、椎管内麻醉可能引起术后头痛、尿潴留、全脊髓麻醉、神经损伤、推管内感染、硬膜外血肿及下肢感觉或运动障碍等。
                    </el-checkbox>
                  </el-checkbox-group>
                </el-form-item>
              </el-form>
            </el-tab-pane>
            <el-tab-pane label="自费同意书" name="third">
              为贯彻执行“保障基本医疗，共创和谐医保”的原则，在麻醉和镇痛实施以及围术期监测过程，需使用医保不能承担的部分药物和材料，由患者自费支付，详细说明如下：<br><br>
              1、麻醉中部分材料和药物
              一次性使用的呼吸膜过滤器、输液过滤器、湿热交换器、脉搏血氧饱和度监测探头、镇痛泵、心排量监测等耗材； <br> <br>
              2、门诊检查或受伤患者所有诊疗及辅助镇静镇痛治疗所涉及的相关费用均为自费。
              <el-form
                ref='thridForm'
                :inline="true"
                :model="dialogLeftTop1_3_data" :rules="appointmentConfirmConst.anesthesiaEvaluation_rules">
                <el-form-item label="本人对以上情况已了解" prop="anaesthesiaAssessment.agreeSelfExpense">
                  <el-radio-group v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.agreeSelfExpense">
                    <el-radio :label="1">同意使用</el-radio>
                    <el-radio :label="0">不同意使用</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-form>
            </el-tab-pane>
            <el-tab-pane label="术后镇痛记录" name="fourth">
              <el-form
                ref='fourthForm'
                :inline="true"
                :model="dialogLeftTop1_3_data" :rules="appointmentConfirmConst.anesthesiaEvaluation_rules">
                <el-form-item label="拟行术式" :label-width="formLabelWidth" prop="anaesthesiaAssessment.subOptId">
                  <!--<el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.subOpt" auto-complete="off" placeholder="请输入"
                            style='width: 196px;'></el-input>-->
                  <el-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.subOptId" auto-complete="off"
                             placeholder="请输入拟行术式"
                             style='width: 196px' filterable remote reserve-keyword :remote-method="getOperation"
                             :loading="loading">
                    <el-option v-for='item in operateSurgeryList' :label="item.name" :value="item.id"
                               :key='item.id'></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="手术日期" :label-width="formLabelWidth" prop="anaesthesiaAssessment.operationDate">
                  <el-date-picker type="date" placeholder="选择日期"
                                  v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.operationDate"
                                  style='width: 196px;' value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
                </el-form-item>
                <el-form-item label="拟行麻醉" :label-width="formLabelWidth" prop="anaesthesiaAssessment.subAnaesthesia">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.subAnaesthesia" placeholder="请选择职业"
                               style='width: 196px' dict-code="mzlb">
                  </dict-select>
                </el-form-item>
                <el-form-item label="麻醉师" :label-width="formLabelWidth" prop="anaesthesiaAssessment.anesthetistId">
                  <el-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.anesthetistId" auto-complete="off"
                             placeholder="请选择职业"
                             style='width: 196px' filterable remote reserve-keyword :remote-method="getDoctor"
                             :loading="loading">
                    <el-option v-for='item in operateDoctorList' :label="item.name" :value="item.id"
                               :key='item.id'></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="PCA开机时间" :label-width="formLabelWidth" prop="anaesthesiaAssessment.pcaStartTime">
                  <el-date-picker type="date" placeholder="选择日期"
                                  v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.pcaStartTime"
                                  style='width: 196px;' value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
                </el-form-item>

                <el-form-item label="机号" :label-width="formLabelWidth" prop="anaesthesiaAssessment.machineNo">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.machineNo" auto-complete="off"
                            placeholder="请输入"
                            style='width: 196px;'></el-input>
                </el-form-item>
                <el-form-item label="镇痛方式" :label-width="formLabelWidth" prop="anaesthesiaAssessment.analgesiaType">
                  <dict-select v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.analgesiaType" placeholder="请选择职业"
                               style='width: 196px' dict-code="zhentongfangshi">
                  </dict-select>
                </el-form-item>
                <el-form-item label="镇痛原机型" :label-width="formLabelWidth"
                              prop="anaesthesiaAssessment.analgesiaOriginalModel">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.analgesiaOriginalModel"
                            auto-complete="off" placeholder="请输入"
                            style='width: 196px;'></el-input>
                </el-form-item>
                <el-form-item label="配方" :label-width="formLabelWidth" prop="anaesthesiaAssessment.formula">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.formula" auto-complete="off"
                            placeholder="请输入"
                            style='width: 196px;'></el-input>
                </el-form-item>
                <el-form-item label="首次剂量" :label-width="formLabelWidth" prop="anaesthesiaAssessment.firstDose">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.firstDose" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">ml</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="持续剂量" :label-width="formLabelWidth" prop="anaesthesiaAssessment.continuousDose">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.continuousDose" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">ml</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="PCA剂量" :label-width="formLabelWidth" prop="anaesthesiaAssessment.pcaDose">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.pcaDose" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">ml</template>
                  </el-input>
                </el-form-item>
                <el-form-item label="锁定时间" :label-width="formLabelWidth" prop="anaesthesiaAssessment.lockTime">
                  <!-- <el-date-picker type="date" placeholder="选择日期" v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.lockTime"
                                   style='width: 196px;' value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>-->
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.lockTime" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                  </el-input>
                </el-form-item>
                <el-form-item label="总量" :label-width="formLabelWidth" prop="anaesthesiaAssessment.total">
                  <el-input v-model="dialogLeftTop1_3_data.anaesthesiaAssessment.total" auto-complete="off"
                            placeholder="请输入"
                            style='width: 276px'>
                    <template slot="append">ml</template>
                  </el-input>
                </el-form-item>
              </el-form>
            </el-tab-pane>
          </el-tabs>
          <!--<div slot="footer" class="dialog-footer">
            <el-button @click="dialogLeftTop1_1 = false">取 消</el-button>
            <el-button type="primary" @click="submitForm('dialogLeftTop1_3_data')">确 定</el-button>
          </div>-->
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import _ from 'lodash'
  import appointmentInfo from '@/yimiviews/components/appointmentInfo'
  import surgeryPath from '@/yimiviews/components/path'
  import { appointmentConfirmConst } from '@/yimiviews/appointmentManage/columnsConst'
  import { saveAssessment, read } from '@/api/appointmentManage/anesthesia'
  import { read as appointRead } from '@/api/appointmentManage/appointmentConfirm'
  import DictSelect from '@/views/form/dictSelect'
  import { getDoctorList, getOperationList } from '@/api/common/common'

  export default {
    components: { DictSelect, appointmentInfo, surgeryPath },
    created() {
      this.getPatientInfo()
      this.getDoctor(' ')
      this.getOperation(' ')
    },
    mounted() {
      this.setAppMainHeight()
    },
    data() {
      return {
        appointment: {
          path: 2
        },
        appointmentInfo: {},
        radio2: '', // 要删掉的
        checkbox: [], // 要删掉的
        textarea: '', // 要删掉的
        appointmentConfirmConst,
        activeName: 'first',
        noticeNos: [],
        anaesthesiaManageType: [],
        neck: [],
        operateDoctorList: [],
        operateSurgeryList: [],
        loading: false,
        dialogLeftTop1_3_data: {
          appointId: '0',
          type: '0',
          anaesthesiaAssessment: {
            id: '',
            appointNo: '0',
            weight: '',
            height: '',
            bmi: '',
            bloodPressure: '',
            heartRate: '',
            breathFreq: '',
            temperature: '',
            bloodType: '',
            medicalBrug: '',
            optAnaesthesiaHistory: '',
            complication: '',
            anaphylaxisHistory: '',
            anaphylaxis: [],
            neck: [],
            fingerNum: '',
            tooth: '',
            cardiopulmonary: '',
            spinalStatus: '',
            upMuscleStrength: '',
            downMuscleStrength: '',
            peripheralVein: '',
            electrocardiogram: '',
            xinchao: '',
            heartFunctionLevel: '',
            lungFunction: '',
            chestCt: '',
            liverFunction: '',
            renalFunction: '',
            hemoglobin: '',
            redBloodCel: '',
            erythrocrit: '',
            thrombinTime: '',
            bloodPotassium: '',
            bloodSodium: '',
            bloodOxygen: '',
            bloodSugar: '',
            asaLevel: '',
            otherInspectExcept: '',
            anaesthesiaType: '',
            checkType: '',
            anaesthesiaManageType: [],
            noticeNos: [],
            agreeSelfExpense: '',
            subOpt: '',
            subOptNo: '',
            subAnaesthesia: '',
            anesthetistName: '',
            anesthetistId: '',
            pcaStart: '',
            pcaStartTime: '',
            machineNo: '',
            analgesiaType: '',
            analgesiaOriginalModel: '',
            formula: '',
            firstDose: '',
            continuousDose: '',
            pcaDose: '',
            lockTime: '',
            total: '',
            operationDate: '',
            subOptId: ''
          }
        },
        dialogLeftTop1_1_data_anesthesiaDoctorList: [],
        anticoagulantTypeOther: '',
        options: [],
        formLabelWidth: '120px'
      }
    },
    methods: {
      getNoticeNos() {
        this.dialogLeftTop1_3_data.anaesthesiaAssessment.noticeNos = this.noticeNos
      },
      getAnaesthesiaManageType() {
        this.dialogLeftTop1_3_data.anaesthesiaAssessment.anaesthesiaManageType = this.anaesthesiaManageType
      },
      getPatientInfo() {
        appointRead(this.$route.params.id).then(res => {
          this.appointmentInfo = res.data.data
        })
        read(this.$route.params.id).then(res => {
          const resData = res.data.data
          if (resData) {
            resData.anaesthesiaManageType = resData.anaesthesiaManageType.split(',')
            resData.noticeNos = resData.noticeNos.split(',')
            resData.neck = _.map(resData.neck.split(','), x => parseInt(x))
            resData.anaphylaxis = _.map(resData.anaphylaxis.split(','), x => parseInt(x))
            this.anaesthesiaManageType = _.map(resData.anaesthesiaManageType, x => parseInt(x))
            this.noticeNos = _.map(resData.noticeNos, x => parseInt(x))
            this.dialogLeftTop1_3_data.anaesthesiaAssessment = resData
          }
        })
      },
      getDoctor(query) {
        if (query !== '') {
          this.loading = true
          setTimeout(() => {
            getDoctorList({ keyword: query.toLowerCase(), type: 1 }).then((res) => {
              this.loading = false
              this.operateDoctorList = res.data.list
            })
          }, 200)
        } else {
          this.operateDoctorList = []
        }
      },
      getOperation(query) {
        if (query !== '') {
          this.loading = true
          setTimeout(() => {
            getOperationList({ keyword: query.toLowerCase() }).then((res) => {
              this.loading = false
              this.operateSurgeryList = res.data.list
            })
          }, 200)
        } else {
          this.operateSurgeryList = []
        }
      },
      handleClick() {
      },
      checkFourthForm() {
        let flag = false
        this.$refs['fourthForm'].validate((valid) => {
          if (valid) {
            flag = true
          }
        })
        return flag
      },
      submitForm(formName, type) {
        const fourthFormValid = this.checkFourthForm()
        console.log(this.dialogLeftTop1_3_data)
        this.$refs[formName].validate((valid) => {
          if (valid && fourthFormValid) {
            var tipText = ['保存成功！', '提交成功！']
            this.dialogLeftTop1_3_data.appointId = this.$route.params.id
            this.dialogLeftTop1_3_data.type = type
            const postdata = JSON.parse(JSON.stringify(this.dialogLeftTop1_3_data))
            postdata.anaesthesiaAssessment.anaesthesiaManageType = this.anaesthesiaManageType.join(',')
            postdata.anaesthesiaAssessment.noticeNos = this.noticeNos.join(',')
            postdata.anaesthesiaAssessment.neck = postdata.anaesthesiaAssessment.neck.join(',')
            postdata.anaesthesiaAssessment.anaphylaxis = postdata.anaesthesiaAssessment.anaphylaxis.join(',')
            saveAssessment(postdata).then((res) => {
              if (res.data.code === 200) {
                this.$message({
                  message: tipText[type],
                  type: 'success',
                  duration: 2000
                })
                if (type === 1) {
                  this.$root.closeTag()
                }
              } else {
                this.$message({
                  message: res.data.msg,
                  type: 'error',
                  duration: 2000
                })
              }
            })
          } else {
            this.$message({
              message: '必填项不能为空！',
              type: 'error',
              duration: 2000
            })
          }
        })
      },
      cancel() {
        this.$root.closeTag()
      },
      setAppMainHeight() {
        const bodyHeight = document.body.offsetHeight
        const appMainHeight = bodyHeight - 180
        this.$refs.scrollWrap.style.height = appMainHeight + 'px'
      }
    },
    watch: {
      'dialogLeftTop1_3_data.anaesthesiaAssessment.subOptId': function() {
        try {
          this.dialogLeftTop1_3_data.anaesthesiaAssessment.subOpt = this.dialogLeftTop1_3_data.anaesthesiaAssessment.subOptId !== ''
            ? _.find(this.operateSurgeryList, { id: this.dialogLeftTop1_3_data.anaesthesiaAssessment.subOptId }).name : ''
          this.dialogLeftTop1_3_data.anaesthesiaAssessment.subOptNo = this.dialogLeftTop1_3_data.anaesthesiaAssessment.subOptId !== ''
            ? _.find(this.operateSurgeryList, { id: this.dialogLeftTop1_3_data.anaesthesiaAssessment.subOptId }).code : ''
        } catch (e) {
          console.log(e)
        }
      },
      'dialogLeftTop1_3_data.anaesthesiaAssessment.anesthetistId': function() {
        try {
          this.dialogLeftTop1_3_data.anaesthesiaAssessment.anesthetistName = this.dialogLeftTop1_3_data.anaesthesiaAssessment.anesthetistId !== ''
            ? _.find(this.operateDoctorList, { id: this.dialogLeftTop1_3_data.anaesthesiaAssessment.anesthetistId }).name : ''
        } catch (e) {
          console.log(e)
        }
      }
    }
  }
</script>
<style lang="scss">
  .anesthesiaEvaluation {
    padding-bottom: 20px;
    background-color: #f0f2f5;
    .margin20 {
      margin: 20px;
      background-color: #fff;
    }
    .box {
      padding: 20px;
    }
    .scrollWrap {
      min-height: 100%;
      overflow: auto;
    }
    .appointmentInfoBox {
      background-color: #fff;
      padding: 0 20px;
    }
    .dialog-footer {
      padding: 10px;
      background-color: #fff;
      margin-bottom: 20px;
    }
    .el-input-group__append {
      width: 80px;
      border: 0 !important;
      background-color: transparent !important;
    }
  }
</style>

